package com.wish.house.controller;

import com.wish.base.dto.RoomInfoDTO;
import com.wish.base.service.IRoomInfoService;
import com.wish.common.core.web.controller.BaseController;
import com.wish.common.core.web.domain.AjaxResult;
import com.wish.common.core.web.page.TableDataInfo;
import com.wish.house.service.ITbRoomInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 张凌飞$
 * @DATE 2022/6/4$
 **/
@RestController
@RequestMapping("/rack")
public class TbRackController extends BaseController {

    @Autowired
    private ITbRoomInfoService roomInfoService;


    /**
     * 是否推荐房源处理
     * @param roomInfoDTO
     * @return
     */
    @PutMapping("/editRecommended")
    public AjaxResult edit(@RequestBody RoomInfoDTO roomInfoDTO)
    {
        return roomInfoService.editRecommended(roomInfoDTO);
    }

    /**
     * 房态图
     */
    @PutMapping("/roomAvailabilityFigure")
    public TableDataInfo roomAvailabilityFigure(@RequestBody RoomInfoDTO roomInfoDTO){
        startPage();
        return roomInfoService.roomAvailabilityFigure(roomInfoDTO);
    }

    /**
     * 修改发布状态
     * @param roomInfoDTO
     * @return
     */
    @PutMapping("/updatePublishStatus")
    public AjaxResult updatePublishStatus(@RequestBody RoomInfoDTO roomInfoDTO){
        return roomInfoService.updatePublishStatus(roomInfoDTO);
    }
}
